package com.lagou.com.lagou.homework.Modules4.item4;

import java.util.Objects;

public class User implements java.io.Serializable{

    private static final long serialVersionUID = 6211366863258603244L;
    private String name;
    private String passcode;

    public User() {
    }

    public User(String name, String passcode) {
        this.name = name;
        this.passcode = passcode;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPasscode() {
        return passcode;
    }

    public void setPasscode(String passcode) {
        this.passcode = passcode;
    }

    @Override
    public String toString() {
        return "User{" +
                "name='" + name + '\'' +
                ", passcode='" + passcode + '\'' +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        User user = (User) o;
        return Objects.equals(name, user.name) &&
                Objects.equals(passcode, user.passcode);
    }

    @Override
    public int hashCode() {
        return Objects.hash(name, passcode);
    }
}
